package com.game.display  
{
	
	
	import com.game.utils.GlobalFun;
	
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	
	public class DisManage extends Sprite
	{
		public static var _main:Sprite
		public static var _alertSP:Sprite;
		public static var tipSP:Sprite;
		public function DisManage()
		{
			init();
		}
		private function init():void{
			_main=new Sprite();
			_alertSP= new Sprite();
			tipSP=new Sprite();
			addChild(_main);
			
			addChild(_alertSP);
			addChild(tipSP);
		}
		public static  function addDis(disObj:DisplayObjectContainer,sp:Sprite=null):void{
			if(disObj==null){
				thisError("addDis(),disObj==null");
				return;
			}
			if(sp==null){
				sp=_main;
			}
			sp.addChild(disObj);
		}
		public static function delDis(disObj:DisplayObjectContainer):void{
			if(disObj==null){
				thisError("delDis(),disObj==null");
				return;
			}
			if(_main.contains(disObj)){
				_main.removeChild(disObj);
			}
		}
		public static  function delAllDis(sp:Sprite=null):void{
			if(sp==null){
				sp=_main;
			}
			GlobalFun.removeAllDisObj(sp);
		}
		private static function thisError(str:String):void{
			trace("DisManage>>"+str);
		}
	}
}